// Copyright 2013 Tumblr, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/* Autogenerated by Thrift Compiler (0.9.0-dev)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 */
package fb303

/**
 *Common status reporting mechanism across all services
 */
type FbStatus int

const (
	DEAD     FbStatus = 0
	STARTING FbStatus = 1
	ALIVE    FbStatus = 2
	STOPPING FbStatus = 3
	STOPPED  FbStatus = 4
	WARNING  FbStatus = 5
)

func (p FbStatus) String() string {
	switch p {
	case DEAD:
		return "DEAD"
	case STARTING:
		return "STARTING"
	case ALIVE:
		return "ALIVE"
	case STOPPING:
		return "STOPPING"
	case STOPPED:
		return "STOPPED"
	case WARNING:
		return "WARNING"
	}
	return ""
}

func FromFbStatusString(s string) FbStatus {
	switch s {
	case "DEAD":
		return DEAD
	case "STARTING":
		return STARTING
	case "ALIVE":
		return ALIVE
	case "STOPPING":
		return STOPPING
	case "STOPPED":
		return STOPPED
	case "WARNING":
		return WARNING
	}
	return FbStatus(-10000)
}

func (p FbStatus) Value() int {
	return int(p)
}

func (p FbStatus) IsEnum() bool {
	return true
}

func init() {
}
